<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: TInputMethod类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="class_t_input_method-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">TInputMethod类 参考</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a53115d8659e8077dfe8a291a851eb91e" id="r_a53115d8659e8077dfe8a291a851eb91e"><td class="memItemLeft" align="right" valign="top"><a id="a53115d8659e8077dfe8a291a851eb91e" name="a53115d8659e8077dfe8a291a851eb91e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TInputMethod</b> (input_method_t *nativeObj)</td></tr>
<tr class="separator:a53115d8659e8077dfe8a291a851eb91e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac15b07e3065cb798f75d25df6bc6461" id="r_aac15b07e3065cb798f75d25df6bc6461"><td class="memItemLeft" align="right" valign="top"><a id="aac15b07e3065cb798f75d25df6bc6461" name="aac15b07e3065cb798f75d25df6bc6461"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TInputMethod</b> (const input_method_t *nativeObj)</td></tr>
<tr class="separator:aac15b07e3065cb798f75d25df6bc6461"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfc3baefddac2f2c5ee69d5dafeb8714" id="r_adfc3baefddac2f2c5ee69d5dafeb8714"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adfc3baefddac2f2c5ee69d5dafeb8714">CommitText</a> (const char *text)</td></tr>
<tr class="separator:adfc3baefddac2f2c5ee69d5dafeb8714"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a498411665d7fdabb61a4bf70db32a379" id="r_a498411665d7fdabb61a4bf70db32a379"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a498411665d7fdabb61a4bf70db32a379">SetLang</a> (const char *lang)</td></tr>
<tr class="separator:a498411665d7fdabb61a4bf70db32a379"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad5dc45d2a1541e151b5bbb3b33f6ee6" id="r_aad5dc45d2a1541e151b5bbb3b33f6ee6"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aad5dc45d2a1541e151b5bbb3b33f6ee6">GetLang</a> ()</td></tr>
<tr class="separator:aad5dc45d2a1541e151b5bbb3b33f6ee6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36159e392001b71358ee35b84ae60691" id="r_a36159e392001b71358ee35b84ae60691"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a36159e392001b71358ee35b84ae60691">DispatchKey</a> (uint32_t key)</td></tr>
<tr class="separator:a36159e392001b71358ee35b84ae60691"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18759e51cd32bd93330bff954f70ff98" id="r_a18759e51cd32bd93330bff954f70ff98"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a18759e51cd32bd93330bff954f70ff98">DispatchKeys</a> (const char *keys)</td></tr>
<tr class="separator:a18759e51cd32bd93330bff954f70ff98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4064965bbb3574c9f95dced6d0e7a787" id="r_a4064965bbb3574c9f95dced6d0e7a787"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4064965bbb3574c9f95dced6d0e7a787">DispatchPreedit</a> ()</td></tr>
<tr class="separator:a4064965bbb3574c9f95dced6d0e7a787"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f6514e00d37e9ccef96f4ce4182df2a" id="r_a4f6514e00d37e9ccef96f4ce4182df2a"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4f6514e00d37e9ccef96f4ce4182df2a">DispatchPreeditConfirm</a> ()</td></tr>
<tr class="separator:a4f6514e00d37e9ccef96f4ce4182df2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77c1de1ddc3bcd95a3ff5b4ef88d981f" id="r_a77c1de1ddc3bcd95a3ff5b4ef88d981f"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a77c1de1ddc3bcd95a3ff5b4ef88d981f">DispatchPreeditAbort</a> ()</td></tr>
<tr class="separator:a77c1de1ddc3bcd95a3ff5b4ef88d981f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a74bab3e08578b1910d0e15a29b8892f4" id="r_a74bab3e08578b1910d0e15a29b8892f4"><td class="memItemLeft" align="right" valign="top"><a id="a74bab3e08578b1910d0e15a29b8892f4" name="a74bab3e08578b1910d0e15a29b8892f4"></a>
static <a class="el" href="class_t_input_method.html">TInputMethod</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (input_method_t *nativeObj)</td></tr>
<tr class="separator:a74bab3e08578b1910d0e15a29b8892f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadc8340dcd3d6b9b177a91754744d3ec" id="r_aadc8340dcd3d6b9b177a91754744d3ec"><td class="memItemLeft" align="right" valign="top"><a id="aadc8340dcd3d6b9b177a91754744d3ec" name="aadc8340dcd3d6b9b177a91754744d3ec"></a>
static <a class="el" href="class_t_input_method.html">TInputMethod</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const input_method_t *nativeObj)</td></tr>
<tr class="separator:aadc8340dcd3d6b9b177a91754744d3ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae652b2cad41da7d9f73b44c7bd99ec9a" id="r_ae652b2cad41da7d9f73b44c7bd99ec9a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_t_input_method.html">TInputMethod</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae652b2cad41da7d9f73b44c7bd99ec9a">Instance</a> ()</td></tr>
<tr class="separator:ae652b2cad41da7d9f73b44c7bd99ec9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a6481a77d3e349d11b8f4ecbc9fe50039" id="r_a6481a77d3e349d11b8f4ecbc9fe50039"><td class="memItemLeft" align="right" valign="top"><a id="a6481a77d3e349d11b8f4ecbc9fe50039" name="a6481a77d3e349d11b8f4ecbc9fe50039"></a>
input_method_t *&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:a6481a77d3e349d11b8f4ecbc9fe50039"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>输入法接口。</p>
<p>常见的实现方式有以下几种：</p>
<p>空实现。用于不需要输入法的嵌入式平台。</p>
<p>缺省实现。用于需要输入法的嵌入式平台。</p>
<p>基于SDL实现的平台原生输入法。用于桌面系统和手机系统。</p>
<blockquote class="doxtable">
<p>输入类型请参考：input_type </p>
</blockquote>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="adfc3baefddac2f2c5ee69d5dafeb8714" name="adfc3baefddac2f2c5ee69d5dafeb8714"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfc3baefddac2f2c5ee69d5dafeb8714">&#9670;&#160;</a></span>CommitText()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::CommitText </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>text</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>提交输入文本。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>文本。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a36159e392001b71358ee35b84ae60691" name="a36159e392001b71358ee35b84ae60691"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36159e392001b71358ee35b84ae60691">&#9670;&#160;</a></span>DispatchKey()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::DispatchKey </td>
          <td>(</td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>key</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>提交按键。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>键值。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a18759e51cd32bd93330bff954f70ff98" name="a18759e51cd32bd93330bff954f70ff98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18759e51cd32bd93330bff954f70ff98">&#9670;&#160;</a></span>DispatchKeys()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::DispatchKeys </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>keys</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>提交按键。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">keys</td><td>键值。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a4064965bbb3574c9f95dced6d0e7a787" name="a4064965bbb3574c9f95dced6d0e7a787"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4064965bbb3574c9f95dced6d0e7a787">&#9670;&#160;</a></span>DispatchPreedit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::DispatchPreedit </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>分发进入预编辑状态的事件。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a77c1de1ddc3bcd95a3ff5b4ef88d981f" name="a77c1de1ddc3bcd95a3ff5b4ef88d981f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77c1de1ddc3bcd95a3ff5b4ef88d981f">&#9670;&#160;</a></span>DispatchPreeditAbort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::DispatchPreeditAbort </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>分发取消预编辑状态的事件(提交预编辑内容，退出预编辑状态)。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a4f6514e00d37e9ccef96f4ce4182df2a" name="a4f6514e00d37e9ccef96f4ce4182df2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f6514e00d37e9ccef96f4ce4182df2a">&#9670;&#160;</a></span>DispatchPreeditConfirm()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::DispatchPreeditConfirm </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>分发确认预编辑状态的事件(提交预编辑内容，退出预编辑状态)。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="aad5dc45d2a1541e151b5bbb3b33f6ee6" name="aad5dc45d2a1541e151b5bbb3b33f6ee6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad5dc45d2a1541e151b5bbb3b33f6ee6">&#9670;&#160;</a></span>GetLang()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * TInputMethod::GetLang </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>获取语言。</p>
<dl class="section return"><dt>返回</dt><dd>返回语言。 </dd></dl>

</div>
</div>
<a id="ae652b2cad41da7d9f73b44c7bd99ec9a" name="ae652b2cad41da7d9f73b44c7bd99ec9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae652b2cad41da7d9f73b44c7bd99ec9a">&#9670;&#160;</a></span>Instance()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_input_method.html">TInputMethod</a> TInputMethod::Instance </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel static">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>获取全局输入法对象。</p>
<dl class="section return"><dt>返回</dt><dd>成功返回输入法对象，失败返回NULL。 </dd></dl>

</div>
</div>
<a id="a498411665d7fdabb61a4bf70db32a379" name="a498411665d7fdabb61a4bf70db32a379"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a498411665d7fdabb61a4bf70db32a379">&#9670;&#160;</a></span>SetLang()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TInputMethod::SetLang </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>lang</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置语言。</p>
<blockquote class="doxtable">
<p>有时在同一种语言环境下，也需要输入多种文字，典型的情况是同时输入中文和英文。 比如T9输入法，可以同时支持中文和英文输入，配合软键盘随时切换输入的语言。 数字、小写字母、大写字母和符合也可以视为输入的语言。 主要用于提示输入法引擎选择适当的输入方法。 </p>
</blockquote>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">lang</td><td>语言。格式为语言+国家/地区码。如：zh_cn和en_us等。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a></li>
<li>output/<b>awtk_cpp.cpp</b></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
</small></address>
</div><!-- doc-content -->
</body>
</html>
